package com.jxc.model.po;

/***********************************************************************
 * Module:  SaleReturnlist.java
 * Author:  Administrator
 * Purpose: Defines the Class SaleReturnlist
 ***********************************************************************/

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 销售退货单
 * 
 * @pdOid f57fea0a-4339-4b0b-a017-b5d7864b4d57
 */
@Entity
@Table(name = "XSGL_SALERETURNLIST")
public class SaleReturnlist extends IdEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7311146048936367441L;
	/**
	 * 日期
	 * 
	 * @pdOid 3f2e3ed4-c800-4bd5-a613-0d4fcefefce5
	 */
	private Date date;
	/**
	 * 单号
	 * 
	 * @pdOid 918e5df6-87a7-40d2-9fd5-8f27995980ba
	 */
	private String serial;
	/**
	 * 营业员
	 * 
	 * @pdOid 54597dbe-31dc-4c7c-9b35-e213cbdcac9a
	 */
	private User user;
	/**
	 * 会员
	 * 
	 * @pdOid ec25a0c5-2cb5-4022-a909-65532d215da3
	 */
	private Member member;
	/**
	 * 仓库
	 * 
	 * @pdOid 4b8cb8b5-132b-4fea-a0a8-90bf8ef106d0
	 */
	private Repertory repertory;
	/**
	 * 退货总额
	 * 
	 * @pdOid 2611b216-f337-473c-a61e-10ae99c85abb
	 */
	private Double total;
	/**
	 * 实退金额
	 * 
	 */
	private Double realReturn;
	/**
	 * 销售单
	 * 
	 */
	private Salelist saleList;
	/**
	 * 备注
	 * 
	 * @pdOid c5af47d4-cbef-4da5-9ebd-f607e39870f6
	 */
	private String remark;

	/**
	 * 销售退货明细
	 */
	private List<SaleReturnlistItem> items = new ArrayList<SaleReturnlistItem>();

	@Column(name = "REAL_RETURN", length = 10)
	public Double getRealReturn() {
		return realReturn;
	}

	public void setRealReturn(Double realReturn) {
		this.realReturn = realReturn;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SALELIST_ID")
	public Salelist getSaleList() {
		return saleList;
	}

	public void setSaleList(Salelist saleList) {
		this.saleList = saleList;
	}

	@Column(name = "DATE")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "SERIAL")
	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne
	@JoinColumn(name = "MEMBER_ID")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@ManyToOne
	@JoinColumn(name = "REPERTORY_ID")
	public Repertory getRepertory() {
		return repertory;
	}

	public void setRepertory(Repertory repertory) {
		this.repertory = repertory;
	}

	@Column(name = "TOTAL", length = 10, precision = 2)
	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, mappedBy = "saleReturnlist", orphanRemoval = true)
	public List<SaleReturnlistItem> getItems() {
		return items;
	}

	public void setItems(List<SaleReturnlistItem> items) {
		this.items = items;
	}

}